<!DOCTYPE html>
<html>
<head>
    <title>MVC Framework Example</title>
</head>
<body>
    <div id="data-display"></div>
    <button onclick="updateData()">Update Data</button>

    <script>
        // 模型
        class Model {
            constructor(data) {
                this.data = data;
            }

            getData() {
                return this.data;
            }
        }

        // 视图
        class View {
            displayData(data) {
                document.getElementById("data-display").innerText = "显示数据：" + data;
            }
        }

        // 控制器
        class Controller {
            constructor(model, view) {
                this.model = model;
                this.view = view;
            }

            updateData() {
                const newData = "更新后的数据";
                this.model.data = newData;
                this.view.displayData(newData);
            }
        }

        // 初始化
        const model = new Model("初始数据");
        const view = new View();
        const controller = new Controller(model, view);

        // 显示初始数据
        view.displayData(model.getData());

        // 更新数据并显示
        function updateData() {
            controller.updateData();
        }
    </script>
</body>
</html>